package com.wx.dao;

import java.util.List;
import java.util.Map;

import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import com.wx.entity.WxFansUser;
import com.wx.entity.WxFansUserExample;

public interface WxFansUserMapper {
    int countByExample(WxFansUserExample example);

    int deleteByExample(WxFansUserExample example);

    int deleteByPrimaryKey(Integer id);

    int insert(WxFansUser record);

    int insertSelective(WxFansUser record);

    List<WxFansUser> selectByExample(WxFansUserExample example);

    WxFansUser selectByPrimaryKey(Integer id);

    int updateByExampleSelective(@Param("record") WxFansUser record, @Param("example") WxFansUserExample example);

    int updateByExample(@Param("record") WxFansUser record, @Param("example") WxFansUserExample example);

    int updateByPrimaryKeySelective(WxFansUser record);

    int updateByPrimaryKey(WxFansUser record);
    
    List<WxFansUser> selectEntityByExample(Map<String, Object> params);
    
    int countEntityByExample(Map<String, Object> params);
    
    List<String> selectAllOpenid(WxFansUserExample example);

	WxFansUser selectByWxidAndOpenid(@Param("wxid")String wxid, @Param("openid")String openid);
	
	@Select("SELECT p1.* FROM wx_fans_user AS p1, wx_user AS p2 WHERE  p1.wxid = p2.wxid AND p1.openid= p2.openid AND p2.id=#{wxUserId,jdbcType=BIGINT}")
	WxFansUser selectByWxUserId(@Param("wxUserId")Long wxUserId);
}